2020-2021 Sunseeker Telemetry and Lighting System
eusci_b_i2c_ex2_slaveTxSingle.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define SLAVE_ADDRESS   0x48
 

Functions

void main (void)
 
void USCIB0_ISR (void)
 

Variables

uint8_t TXData = 0x00
 

Macro Definition Documentation

◆ SLAVE_ADDRESS

#define SLAVE_ADDRESS   0x48

Description: This demo connects two MSP430's via the I2C bus. The master reads from the slave. This is the SLAVE code. The TX data begins at 0 and is incremented each time it is sent. A stop condition is used as a trigger to increment the outgoing data. The USCI_B0 TX interrupt is used to know when to TX. Tested on MSP430FR4133

                          /|\  /|\
         MSP430FR4133      10k  10k     MSP430FR4133
             slave         |    |        master
       -----------------   |    |   -----------------
     -|XIN  P5.2/UCB0SDA|<-|----+->|P5.2/UCB0SDA  XIN|-
      |                 |  |       |                 | 32kHz
     -|XOUT             |  |       |             XOUT|-
      |     P5.3/UCB0SCL|<-+------>|P5.3/UCB0SCL     |
      |                 |          |             P1.0|--> LED

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • I2C peripheral
  • GPIO Port peripheral (for I2C pins)
  • SCL2
  • SDA
  • CS

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • USCI_B0_VECTOR.

Definition at line 79 of file eusci_b_i2c_ex2_slaveTxSingle.c.

Function Documentation

◆ main()

void main ( void  )

Definition at line 83 of file eusci_b_i2c_ex2_slaveTxSingle.c.

References __no_operation(), param, and SLAVE_ADDRESS.

◆ USCIB0_ISR()

void USCIB0_ISR ( void  )

Definition at line 139 of file eusci_b_i2c_ex2_slaveTxSingle.c.

References TXData.

Variable Documentation

◆ TXData

uint8_t TXData = 0x00

Definition at line 81 of file eusci_b_i2c_ex2_slaveTxSingle.c.